using Godot;
using System;

namespace CurrentGame.Levels;


public partial class LevelTeleport : Area2D
{
    [Export]
    public string NextSceneName { get; set; } = "";
    [Export]
    public float SceneIntervalTime { get; set; } = 1.0f;

    // Node references
    private Player _player;

    public override void _Ready()
    {
        var map = GetNode<NodeReferenceMap>(Constants.NodeRefMapPath);
        _player = map.MainPlayer;
    }

    // Export interfaces
    public void Teleport()
    {
        _player.StartTargetLevel(NextSceneName, SceneIntervalTime);
    }

}
